package com.ken.work.mvc;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.ken.work.mvc.entity.ReflectObj;

public class SystemMapping {

	private static final Logger LOG = Logger.getLogger(SystemMapping.class);  
	private static Map<String, ReflectObj> controllerMap=new HashMap<String, ReflectObj>();
	
	public static void put(String uri,ReflectObj reflectObj){
		if(controllerMap.containsKey(uri))
			controllerMap.remove(uri);
		controllerMap.put(uri, reflectObj);
	}
	public static void put(String uri, Class classUri,Method method)
	{
		if(controllerMap.containsKey(uri))
			controllerMap.remove(uri);
		controllerMap.put(uri, new ReflectObj(classUri,method));
	}
	public static ReflectObj get(String uri)
	{
		if(!controllerMap.containsKey(uri))
			return null;
		else {
			return controllerMap.get(uri);
		}
		 
	}
	public static void clear()
	{
		controllerMap.clear();
	}
}
